[collectionId].js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. "use strict";
  2. (() => {
  3. var exports = {};
  4. exports.id = 9319;
  5. exports.ids = [9319,64820];
  6. exports.modules = {
  7. /***/ 43439:
  8. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  9. __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
  10. __webpack_require__.r(__webpack_exports__);
  11. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  12. /* harmony export */ "default": () => (/* binding */ pageWrapperTemplate),
  13. /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps),
  14. /* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
  15. /* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
  16. /* harmony export */ });
  17. /* harmony import */ var _sentry_server_config_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(96270);
  18. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(58097);
  19. /* harmony import */ var _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__);
  20. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20997);
  21. /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
  22. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16689);
  23. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);
  24. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71853);
  25. /* harmony import */ var next_router__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_router__WEBPACK_IMPORTED_MODULE_4__);
  26. /* harmony import */ var _components_Collection_CollectionDetailContainer_CollectionDetailContainer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45865);
  27. /* harmony import */ var _utils_eventLogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(55943);
  28. /* harmony import */ var src_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(13830);
  29. /* harmony import */ var src_utils_chapter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(95892);
  30. /* harmony import */ var types_CollectionSortOptions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6059);
  31. var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_components_Collection_CollectionDetailContainer_CollectionDetailContainer__WEBPACK_IMPORTED_MODULE_5__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_6__]);
  32. ([_components_Collection_CollectionDetailContainer_CollectionDetailContainer__WEBPACK_IMPORTED_MODULE_5__, _utils_eventLogger__WEBPACK_IMPORTED_MODULE_6__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
  33. const CollectionDetailPage = ()=>{
  34. const router = (0,next_router__WEBPACK_IMPORTED_MODULE_4__.useRouter)();
  35. const { 0: sortBy , 1: setSortBy } = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(types_CollectionSortOptions__WEBPACK_IMPORTED_MODULE_9__/* .CollectionDetailSortOption.VerseKey */ .l.VerseKey);
  36. const onSortByChange = (newSortByVal)=>{
  37. (0,_utils_eventLogger__WEBPACK_IMPORTED_MODULE_6__/* .logValueChange */ .Q8)("collection_detail_page_sort_by", sortBy, newSortByVal);
  38. setSortBy(newSortByVal);
  39. };
  40. const collectionId = router.query.collectionId;
  41. /**
  42. * Get the SWR key for cursor based pagination
  43. * - when the page index is still 0 (first fetch). the get the bookmarkByCollection url without `cursor` param
  44. * - on the next fetch, add `cursor` to the parameters
  45. *
  46. * corner case
  47. * - when previous fetch contains empty data, stop fetching
  48. * - when the user is logged out, don't fetch the data
  49. *
  50. * Reference: https://swr.vercel.app/docs/pagination#useswrinfinite
  51. *
  52. * @returns {string} swr key
  53. */ const getKey = (pageIndex, previousPageData)=>{
  54. if (previousPageData && !previousPageData.data) return null;
  55. if (pageIndex === 0) {
  56. return (0,src_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_7__/* .makeGetBookmarkByCollectionId */ .Ix)(collectionId, {
  57. sortBy
  58. });
  59. }
  60. const cursor = previousPageData.pagination?.endCursor;
  61. return (0,src_utils_auth_apiPaths__WEBPACK_IMPORTED_MODULE_7__/* .makeGetBookmarkByCollectionId */ .Ix)(collectionId, {
  62. sortBy,
  63. cursor
  64. });
  65. };
  66. return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_components_Collection_CollectionDetailContainer_CollectionDetailContainer__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
  67. sortBy: sortBy,
  68. getSWRKey: getKey,
  69. onSortByChange: onSortByChange
  70. });
  71. };
  72. const getStaticProps$1 = async ({ locale })=>{
  73. const allChaptersData = await (0,src_utils_chapter__WEBPACK_IMPORTED_MODULE_8__/* .getAllChaptersData */ .T4)(locale);
  74. return {
  75. props: {
  76. chaptersData: allChaptersData
  77. }
  78. };
  79. };
  80. const getStaticPaths = async ()=>({
  81. paths: [],
  82. fallback: "blocking"
  83. });
  84. var serverComponentModule = /*#__PURE__*/Object.freeze({
  85. __proto__: null,
  86. getStaticProps: getStaticProps$1,
  87. getStaticPaths: getStaticPaths,
  88. 'default': CollectionDetailPage
  89. });
  90. /*
  91. * This file is a template for the code which will be substituted when our webpack loader handles non-API files in the
  92. * `pages/` directory.
  93. *
  94. * We use `__SENTRY_WRAPPING_TARGET_FILE__.cjs` as a placeholder for the path to the file being wrapped. Because it's not a real package,
  95. * this causes both TS and ESLint to complain, hence the pragma comments below.
  96. */
  97. const userPageModule = serverComponentModule ;
  98. const pageComponent = userPageModule ? userPageModule.default : undefined;
  99. const origGetInitialProps = pageComponent ? pageComponent.getInitialProps : undefined;
  100. const origGetStaticProps = userPageModule ? userPageModule.getStaticProps : undefined;
  101. const origGetServerSideProps = userPageModule ? userPageModule.getServerSideProps : undefined;
  102. // eslint-disable-next-line @typescript-eslint/no-explicit-any
  103. const getInitialPropsWrappers = {
  104. '/_app': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapAppGetInitialPropsWithSentry,
  105. '/_document': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapDocumentGetInitialPropsWithSentry,
  106. '/_error': _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapErrorGetInitialPropsWithSentry,
  107. };
  108. const getInitialPropsWrapper = getInitialPropsWrappers['/collections/[collectionId]'] || _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetInitialPropsWithSentry;
  109. if (pageComponent && typeof origGetInitialProps === 'function') {
  110. pageComponent.getInitialProps = getInitialPropsWrapper(origGetInitialProps) ;
  111. }
  112. const getStaticProps =
  113. typeof origGetStaticProps === 'function'
  114. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetStaticPropsWithSentry(origGetStaticProps, '/collections/[collectionId]')
  115. : undefined;
  116. const getServerSideProps =
  117. typeof origGetServerSideProps === 'function'
  118. ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapGetServerSidePropsWithSentry(origGetServerSideProps, '/collections/[collectionId]')
  119. : undefined;
  120. const pageWrapperTemplate = pageComponent ? _sentry_nextjs__WEBPACK_IMPORTED_MODULE_1__.wrapPageComponentWithSentry(pageComponent ) : pageComponent;
  121. __webpack_async_result__();
  122. } catch(e) { __webpack_async_result__(e); } });
  123. /***/ }),
  124. /***/ 75184:
  125. /***/ ((module) => {
  126. module.exports = require("@reduxjs/toolkit");
  127. /***/ }),
  128. /***/ 58097:
  129. /***/ ((module) => {
  130. module.exports = require("@sentry/nextjs");
  131. /***/ }),
  132. /***/ 59003:
  133. /***/ ((module) => {
  134. module.exports = require("classnames");
  135. /***/ }),
  136. /***/ 59606:
  137. /***/ ((module) => {
  138. module.exports = require("humps");
  139. /***/ }),
  140. /***/ 12372:
  141. /***/ ((module) => {
  142. module.exports = require("lodash/findKey");
  143. /***/ }),
  144. /***/ 98492:
  145. /***/ ((module) => {
  146. module.exports = require("lodash/groupBy");
  147. /***/ }),
  148. /***/ 35526:
  149. /***/ ((module) => {
  150. module.exports = require("lodash/random");
  151. /***/ }),
  152. /***/ 64042:
  153. /***/ ((module) => {
  154. module.exports = require("lodash/range");
  155. /***/ }),
  156. /***/ 16641:
  157. /***/ ((module) => {
  158. module.exports = require("next-seo");
  159. /***/ }),
  160. /***/ 60866:
  161. /***/ ((module) => {
  162. module.exports = require("next-translate/useTranslation");
  163. /***/ }),
  164. /***/ 3280:
  165. /***/ ((module) => {
  166. module.exports = require("next/dist/shared/lib/app-router-context.js");
  167. /***/ }),
  168. /***/ 92796:
  169. /***/ ((module) => {
  170. module.exports = require("next/dist/shared/lib/head-manager-context.js");
  171. /***/ }),
  172. /***/ 3539:
  173. /***/ ((module) => {
  174. module.exports = require("next/dist/shared/lib/i18n/detect-domain-locale.js");
  175. /***/ }),
  176. /***/ 34014:
  177. /***/ ((module) => {
  178. module.exports = require("next/dist/shared/lib/i18n/normalize-locale-path.js");
  179. /***/ }),
  180. /***/ 78524:
  181. /***/ ((module) => {
  182. module.exports = require("next/dist/shared/lib/is-plain-object.js");
  183. /***/ }),
  184. /***/ 78020:
  185. /***/ ((module) => {
  186. module.exports = require("next/dist/shared/lib/mitt.js");
  187. /***/ }),
  188. /***/ 64406:
  189. /***/ ((module) => {
  190. module.exports = require("next/dist/shared/lib/page-path/denormalize-page-path.js");
  191. /***/ }),
  192. /***/ 24964:
  193. /***/ ((module) => {
  194. module.exports = require("next/dist/shared/lib/router-context.js");
  195. /***/ }),
  196. /***/ 93431:
  197. /***/ ((module) => {
  198. module.exports = require("next/dist/shared/lib/router/utils/add-locale.js");
  199. /***/ }),
  200. /***/ 11751:
  201. /***/ ((module) => {
  202. module.exports = require("next/dist/shared/lib/router/utils/add-path-prefix.js");
  203. /***/ }),
  204. /***/ 46220:
  205. /***/ ((module) => {
  206. module.exports = require("next/dist/shared/lib/router/utils/compare-states.js");
  207. /***/ }),
  208. /***/ 10299:
  209. /***/ ((module) => {
  210. module.exports = require("next/dist/shared/lib/router/utils/format-next-pathname-info.js");
  211. /***/ }),
  212. /***/ 23938:
  213. /***/ ((module) => {
  214. module.exports = require("next/dist/shared/lib/router/utils/format-url.js");
  215. /***/ }),
  216. /***/ 29565:
  217. /***/ ((module) => {
  218. module.exports = require("next/dist/shared/lib/router/utils/get-asset-path-from-route.js");
  219. /***/ }),
  220. /***/ 35789:
  221. /***/ ((module) => {
  222. module.exports = require("next/dist/shared/lib/router/utils/get-next-pathname-info.js");
  223. /***/ }),
  224. /***/ 1897:
  225. /***/ ((module) => {
  226. module.exports = require("next/dist/shared/lib/router/utils/is-bot.js");
  227. /***/ }),
  228. /***/ 1428:
  229. /***/ ((module) => {
  230. module.exports = require("next/dist/shared/lib/router/utils/is-dynamic.js");
  231. /***/ }),
  232. /***/ 28854:
  233. /***/ ((module) => {
  234. module.exports = require("next/dist/shared/lib/router/utils/parse-path.js");
  235. /***/ }),
  236. /***/ 91292:
  237. /***/ ((module) => {
  238. module.exports = require("next/dist/shared/lib/router/utils/parse-relative-url.js");
  239. /***/ }),
  240. /***/ 34567:
  241. /***/ ((module) => {
  242. module.exports = require("next/dist/shared/lib/router/utils/path-has-prefix.js");
  243. /***/ }),
  244. /***/ 80979:
  245. /***/ ((module) => {
  246. module.exports = require("next/dist/shared/lib/router/utils/querystring.js");
  247. /***/ }),
  248. /***/ 93297:
  249. /***/ ((module) => {
  250. module.exports = require("next/dist/shared/lib/router/utils/remove-trailing-slash.js");
  251. /***/ }),
  252. /***/ 36052:
  253. /***/ ((module) => {
  254. module.exports = require("next/dist/shared/lib/router/utils/resolve-rewrites.js");
  255. /***/ }),
  256. /***/ 84226:
  257. /***/ ((module) => {
  258. module.exports = require("next/dist/shared/lib/router/utils/route-matcher.js");
  259. /***/ }),
  260. /***/ 95052:
  261. /***/ ((module) => {
  262. module.exports = require("next/dist/shared/lib/router/utils/route-regex.js");
  263. /***/ }),
  264. /***/ 59232:
  265. /***/ ((module) => {
  266. module.exports = require("next/dist/shared/lib/utils.js");
  267. /***/ }),
  268. /***/ 71853:
  269. /***/ ((module) => {
  270. module.exports = require("next/router");
  271. /***/ }),
  272. /***/ 16689:
  273. /***/ ((module) => {
  274. module.exports = require("react");
  275. /***/ }),
  276. /***/ 6022:
  277. /***/ ((module) => {
  278. module.exports = require("react-redux");
  279. /***/ }),
  280. /***/ 20997:
  281. /***/ ((module) => {
  282. module.exports = require("react/jsx-runtime");
  283. /***/ }),
  284. /***/ 52648:
  285. /***/ ((module) => {
  286. module.exports = require("refresh-fetch");
  287. /***/ }),
  288. /***/ 74973:
  289. /***/ ((module) => {
  290. module.exports = import("@radix-ui/react-collapsible");;
  291. /***/ }),
  292. /***/ 77715:
  293. /***/ ((module) => {
  294. module.exports = import("@radix-ui/react-dialog");;
  295. /***/ }),
  296. /***/ 31481:
  297. /***/ ((module) => {
  298. module.exports = import("@radix-ui/react-dropdown-menu");;
  299. /***/ }),
  300. /***/ 66704:
  301. /***/ ((module) => {
  302. module.exports = import("@radix-ui/react-tooltip");;
  303. /***/ }),
  304. /***/ 88813:
  305. /***/ ((module) => {
  306. module.exports = import("firebase/compat/analytics");;
  307. /***/ }),
  308. /***/ 33773:
  309. /***/ ((module) => {
  310. module.exports = import("firebase/compat/app");;
  311. /***/ }),
  312. /***/ 3590:
  313. /***/ ((module) => {
  314. module.exports = import("react-toastify");;
  315. /***/ }),
  316. /***/ 79847:
  317. /***/ ((module) => {
  318. module.exports = import("swr/immutable");;
  319. /***/ }),
  320. /***/ 91448:
  321. /***/ ((module) => {
  322. module.exports = import("swr/infinite");;
  323. /***/ }),
  324. /***/ 63477:
  325. /***/ ((module) => {
  326. module.exports = require("querystring");
  327. /***/ })
  328. };
  329. ;
  330. // load runtime
  331. var __webpack_require__ = require("../../webpack-runtime.js");
  332. __webpack_require__.C(exports);
  333. var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
  334. var __webpack_exports__ = __webpack_require__.X(0, [11497,79165,96270,24709,57933,61239,25869,50497,76410,79717,13830,37883,12951,36049,85949,62093,99163,5639,46570,57072,67972,50373,47658,45865], () => (__webpack_exec__(43439)));
  335. module.exports = __webpack_exports__;
  336. })();
  337. //# sourceMappingURL=[collectionId].js.map